import React from 'react';
import ReactDOM from 'react-dom';
let Context = React.createContext()

class Btn extends React.PureComponent{
  static contextType = Context
  render(){
    console.log(this)
    return <button>{this.context.title}</button>
  }
}
class Show extends React.PureComponent{
  static contextType = Context
  render(){
    console.log(this)
    return <div>
      <Btn/>
      hahahah{this.context.theme}
    </div>
  }
}

class App extends React.Component {
   
    
    render() {
        return <div className=''>
            <Show></Show>
        </div>;
    }
}

ReactDOM.render(
<Context.Provider  value={{theme:'red',title:"珠峰"}}>
  <App/>
</Context.Provider>,document.getElementById('root'))